import Vue from 'vue'
import Router from 'vue-router'

import employeeServ  from '@/components/router-component/employeeService'

//集团高管
const HighLeaderCard = r => require.ensure([],() => r(require('@/components/highLeaderCard/HighLeaderCard')),'HighLeaderCard')
const HighLeaderList = r => require.ensure([],() => r(require('@/components/highLeaderList/HighLeaderList')),'HighLeaderList')
//总部员工
const StaffCard = r => require.ensure([],() => r(require('@/components/staffCard/StaffCard')),'StaffCard')
const StaffList = r => require.ensure([],() => r(require('@/components/staffList/StaffList')),'StaffList')
const Homepage = r => require.ensure([],() => r(require('@/components/Homepage')),'Homepage')
//集团高管
// const Homepage = r => require.ensure([],() => r(require('@/components/Homepage')),'Homepage')
const highLeader = r => require.ensure([],() => r(require('@/components/router-component/highLeader')),'highLeader')

const home = r => require.ensure([],() => r(require('@/components/home')),'home')
const login = r => require.ensure([],() => r(require('@/components/router-component/login')),'login')
const dept = r => require.ensure([],() => r(require('@/components/personal/dept')),'dept')
const backWorkLeader = r => require.ensure([],() => r(require('@/components/leader/backWorkLeader')),'backWorkLeader')
const keyEmployee = r => require.ensure([],() => r(require('@/components/router-component/keyEmployee')),'keyEmployee')
const groupDept = r => require.ensure([],() => r(require('@/components/router-component/groupDept')),'groupDept')
const degree = r => require.ensure([],() => r(require('@/components/router-component/degree')),'degree')
const deptSort = r => require.ensure([],() => r(require('@/components/router-component/deptSort')),'deptSort')
const leaderLook = r => require.ensure([], () => r(require('@/components/router-component/leaderLook')), 'leaderLook')
const cxoLook = r =>
	require.ensure(
		[],
		() => r(require('@/components/router-component/cxoLook')),
		'cxoLook'
	)
const hqStaff = r => require.ensure([], () => r(require('@/components/router-component/hqStaff')), 'hqStaff')
const allStaff = r => require.ensure([], () => r(require('@/components/router-component/allStaff')), 'allStaff')
const paymentData = r => require.ensure([], () => r(require('@/components/router-component/paymentData')), 'paymentData')

const approvalAll = r => require.ensure([], () => r(require('@/components/router-component/approvalAll')), 'approvalAll')
const noticeAll = r => require.ensure([], () => r(require('@/components/router-component/noticeAll')), 'noticeAll')
const mySalary = r => require.ensure([], () => r(require('@/components/router-component/mySalary')), 'mySalary')
const Keypostsettings = r => require.ensure([], () => r(require('@/components/router-component/Keypostsettings')), 'Keypostsettings')

const vacaManage = r => require.ensure([], () => r(require('@/components/router-component/vacaManageNew')), 'vacaManage')
const vacaMaintain = r => require.ensure([], () => r(require('@/components/router-component/vacaMaintainNew')), 'vacaMaintain')
const projectManage = r => require.ensure([], () => r(require('@/components/router-component/projectManage/index')), 'projectManage')
const rulesManage = r => require.ensure([], () => r(require('@/components/router-component/rulesManage/index')), 'rulesManage')
const detailManage = r => require.ensure([], () => r(require('@/components/router-component/detailManage/index')), 'detailManage')
const datasManage = r => require.ensure([], () => r(require('@/components/router-component/datasManage/index')), 'datasManage')


const templateManage = r => require.ensure([], () => r(require('@/components/router-component/templateManage/index')), 'templateManage')
const nodeManage = r => require.ensure([], () => r(require('@/components/router-component/nodeManage/index')), 'nodeManage')

const commonManage = r => require.ensure([], () => r(require('@/components/router-component/commonManage/index')), 'commonManage')
const rolesManage = r => require.ensure([], () => r(require('@/components/router-component/rolesManage/index')), 'rolesManage')

const Group = r => require.ensure([], () => r(require('@/components/router-component/groupTree')), 'group')
const keyEmpployeeTree = r => require.ensure([], () => r(require('@/components/router-component/keyEmpployeeTree')), 'group')
const executivePay = r => require.ensure([], () => r(require('@/components/executivePay/executivePay')), 'executivePay')
const mySend = r => require.ensure([], () => r(require('@/components/employee/requestVacation/mySend')), 'mySend')
const myLeaderSend = r => require.ensure([], () => r(require('@/components/employee/requestVacation/myLeaderSend')), 'myLeaderSend')
const myBackout = r => require.ensure([], () => r(require('@/components/employee/requestVacation/myBackout')), 'myBackout')
const requestVacation = r => require.ensure([], () => r(require('@/components/employee/requestVacation')), 'requestVacation')
const t1detail = r => require.ensure([], () => r(require('@/components/employee/requestVacation/tab1detail')), 't1detail')
const t2detail = r => require.ensure([], () => r(require('@/components/employee/requestVacation/tab2detail')), 't2detail')
const t3detail = r => require.ensure([], () => r(require('@/components/employee/requestVacation/tab3detail')), 't3detail')
const t4detail = r => require.ensure([], () => r(require('@/components/employee/requestVacation/tab4detail')), 't4detail')
const t5detail = r => require.ensure([], () => r(require('@/components/employee/requestVacation/tab5detail')), 't5detail')

// 权限管理
const userManager = r => require.ensure([], () => r(require('@/components/router-component/user')), 'userManager')
const roleManage = r => require.ensure([],() => r(require('@/components/router-component/roleManage')),'roleManage')
const menuManage = r => require.ensure([],() => r(require('@/components/router-component/menuManage')),'menuManage')
const dataManage = r => require.ensure([],() => r(require('@/components/router-component/dataManage')),'dataManage')

const authority = r => require.ensure([],() => r(require('@/components/router-component/authority')),'authority')
// const MenuManage = r => require.ensure([],() => r(require('@/components/router-component/powerManage/MenuManage')),'MenuManage');

//业务数据设置
const NoticeManage = r => require.ensure([], () => r(require('@/components/router-component/businessSet/NoticeManage')), 'NoticeManage')
const RecruitManage = r => require.ensure([], () => r(require('@/components/router-component/businessSet/RecruitManage')), 'RecruitManage')
const HrTargetManage = r => require.ensure([], () => r(require('@/components/router-component/businessSet/HrTargetManage')), 'HrTargetManage')
const TargetBusiness = r => require.ensure([], () => r(require('@/components/router-component/businessSet/TargetBusiness')), 'TargetBusiness')
const StaffRank = r => require.ensure([], () => r(require('@/components/router-component/businessSet/StaffRank')), 'StaffRank')
const RankPreIncome = r => require.ensure([], () => r(require('@/components/router-component/businessSet/RankPreIncome')), 'RankPreIncome')
const ManagerPreIncome = r => require.ensure([], () => r(require('@/components/router-component/businessSet/ManagerPreIncome')), 'ManagerPreIncome')
const employRoster = r => require.ensure([], () => r(require('@/components/router-component/employRoster')), 'employRoster')
const employRostert = r => require.ensure([], () => r(require('@/components/router-component/employRostert')), 'employRostert')
//信息共享
const InformationShare = r => require.ensure([], () => r(require('@/components/router-component/informationShare')), 'InformationShare')
const backStageManager = r => require.ensure([], () => r(require('@/components/router-component/backStageManager')), 'backStageManager')
const PersonnelRecord = r => require.ensure([], () => r(require('@/components/router-component/PersonnelRecord')), 'PersonnelRecord')
const homepage2 = r => require.ensure([], () => r(require('@/components/router-component/homepage2/index')), 'homepage2')
const myVacation = r => require.ensure([], () => r(require('@/components/router-component/homepage2/myVacation/index')), 'myVacation')
const shareInfo = r => require.ensure([], () => r(require('@/components/router-component/shareInfo/index')), 'shareInfo')

const backupSetting = r => require.ensure([], () => r(require('@/components/router-component/backupSettingNew')), 'backupSetting')
const operation = r => require.ensure([], () => r(require('@/components/router-component/operation')), 'operation')
const companyAuthSet = r => require.ensure([], () => r(require('@/components/router-component/companyAuthSet')), 'companyAuthSet')
const secretarySetting = r => require.ensure([], () => r(require('@/components/router-component/secretarySettingNew')), 'secretarySetting')
const salaryMonitor = r => require.ensure([], () => r(require('@/components/router-component/monitor/salaryMonitor/index')), 'salaryMonitor')


//休假统计报表
const vacationTable = r => require.ensure([], () => r(require('@/components/router-component/vacationTable/index')), 'vacationTable')
// 人工成本标准化管理报表
const laborCost = r => require.ensure([], () => r(require('@/components/router-component/laborCost/index')), 'laborCost')
// 员工基本情况统计报表
const baseCase = r => require.ensure([], () => r(require('@/components/router-component/baseCase/index')), 'baseCase')

//员工假期时间修改
const peoVacaModify = r => require.ensure([], () => r(require('@/components/router-component/peoVacaModify')), 'peoVacaModify')

// 员工信息月报表
const staffInfo = r => require.ensure([], () => r(require('@/components/router-component/staffInfo/index')), 'staffInfo')

const laborMonthTable = r => require.ensure([], () => r(require('@/components/router-component/laborMonthTable')), 'laborMonthTable')


// 离职人员月报表
const levelEm = r => require.ensure([], () => r(require('@/components/router-component/levelEm/index')), 'levelEm')
// 新进人员详表
const newComers = r => require.ensure([], () => r(require('@/components/router-component/newComers/index')), 'newComers')
// 外派人员报表相关
const outComers = r => require.ensure([], () => r(require('@/components/router-component/outComers/index')), 'outComers')
// 异动人员报表
const empChange = r => require.ensure([], () => r(require('@/components/router-component/empChange/index')), 'empChange')

//请休假设置
const leaveSetting = r => require.ensure([], () => r(require('@/components/router-component/leaveSetting')), 'leaveSetting')



//人员变动报表
const personChange = r => require.ensure([], () => r(require('@/components/router-component/personChange')), 'personChange')

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '*',
      redirect: '/employeeServ'
    },
    {
      path: '/homepage2',
      name: 'homepage2',
      component: homepage2,
      children: [
        {
          path: '/homepage2/myVacation',
          name: 'myVacation',
          component: myVacation,
          title: '我的休假'
        }
        // {
        //   path: '/homepage2/myVacation',
        //   name: 'mySalary',
        //   component: myVacation,
        //   title: '我的工资'
        // },
        // {
        //   path: '/homepage2/sendVacation',
        //   name: 'sendVacation',
        //   component: myVacation,
        //   title: '发起休假'
        // }
      ]
    },
    {
      path: '/home',
      name: 'HomePage',
      component: home,
      children: [
        {
          path: 'laborMonthTable',
          name: 'laborMonthTable',
          component: laborMonthTable
        },

        {
          path: 'personChange',
          name: 'personChange',
          component: personChange
        },
        {
          path: 'salaryMonitor',
          name: 'salaryMonitor',
          component: salaryMonitor
        },
        {
          path: 'empChange',
          name: 'empChange',
          component: empChange
        },
        {
          path: 'outComers',
          name: 'outComers',
          component: outComers
        },
        {
          path: 'newComers',
          name: 'newComers',
          component: newComers
        },
        {
          path: 'levelEm',
          name: 'levelEm',
          component: levelEm
        },
        {
          path: 'staffInfo',
          name: 'staffInfo',
          component: staffInfo
        },
        {
          path: 'vacationTable',
          name: 'vacationTable',
          component: vacationTable
        },
        {
          path: 'shareInfo',
          name: 'shareInfo',
          component: shareInfo
        },
        {
          path: 'Group',
          name: 'Group',
          component: Group
        },
        {
          path: 'highLeaderCard',
          name: 'HighLeaderCard',
          component: HighLeaderCard
        },

        {
          path: 'highLeaderList',
          name: 'HighLeaderList',
          component: HighLeaderList
        },
        {
          path: 'staffCard',
          name: 'StaffCard',
          component: StaffCard
        },
        {
          path: 'staffList',
          name: 'StaffList',
          component: StaffList
        },
        {
          path: 'homepage',
          name: 'Homepage',
          component: Homepage,
          props: route => ({ query: route.query.q })
        },
        {
          path: 'highLeader',
          name: 'highLeader',
          component: highLeader
        },
        {
          path: 'dept',
          name: 'dept',
          component: dept
        },
        {
          path: 'backWorkLeader',
          name: 'backWorkLeader',
          component: backWorkLeader
        },
        {
          path: 'keyEmployee',
          name: 'keyEmployee',
          component: keyEmployee
        },
        {
          path: 'groupDept',
          name: 'groupDept',
          component: groupDept
        },
        {
          path: 'leaderLook',
          name: 'leaderLook',
          component: leaderLook
        },
        {
          path: 'cxoLook',
          name: 'cxoLook',
          component: cxoLook
        },
        {
          path: 'hqStaff',
          name: 'hqStaff',
          component: hqStaff
        },
        {
          path: 'allStaff',
          name: 'allStaff',
          component: allStaff
        },
        {
          path: 'paymentData',
          name: 'paymentData',
          component: paymentData
        },
        {
          path: 'Keypostsettings',
          name: 'Keypostsettings',
          component: Keypostsettings
        },
        {
          path: 'keyEmpployeeTree',
          name: 'keyEmpployeeTree',
          component: keyEmpployeeTree
        },
        {
          //员工花名册
          path: 'employRoster',
          name: 'employRoster',
          component: employRoster
        },
        // 员工基本情况统计报表
        {
          path: 'baseCase',
          name: 'baseCase',
          component: baseCase
        },
        // 人工成本标准化管理报表
        {
          path: 'laborCost',
          name: 'laborCost',
          component: laborCost
        },
        {
          //员工花名册
          path: 'employRostert',
          name: 'employRostert',
          component: employRostert
        }
      ]
    },
    {
      path: '/loginToHuaYun',
      name: 'login',
      component: login
    },
    {
      path: '/employeeServ',
      name: 'employeeServ',
      component: employeeServ
    },
    {
      path: '/backupSetting',
      name: 'backupSetting',
      component: backupSetting
    },
    {
      path: '/approvalAll',
      name: 'approvalAll',
      component: approvalAll
    },
    {
      path: '/noticeAll',
      name: 'noticeAll',
      component: noticeAll
    },
    {
      path: '/mySalary',
      name: 'mySalary',
      component: mySalary
    },
    // {
    //   path: '/vacationTable',
    //   name: 'vacationTable',
    //   component: vacationTable
    // },
    {
      path: '/requestVacation',
      name: 'requestVacation',
      component: requestVacation
    },
    {
      path: '/mySend',
      name: 'mySend',
      component: mySend
    },
    {
      path: '/myLeaderSend',
      name: 'myLeaderSend',
      component: myLeaderSend
    },
    {
      path: '/myBackout',
      name: 'myBackout',
      component: myBackout
    },
    {
      path: '/requestVacation/t1detail',
      name: 't1detail',
      component: t1detail
    },
    {
      path: '/requestVacation/t2detail',
      name: 't2detail',
      component: t2detail
    },
    {
      path: '/requestVacation/t3detail',
      name: 't3detail',
      component: t3detail
    },
    {
      path: '/requestVacation/t4detail',
      name: 't4detail',
      component: t4detail
    },
    {
      path: '/requestVacation/t5detail',
      name: 't5detail',
      component: t5detail
    },
    {
      path: '/informationShare',
      name: 'informationShare',
      component: InformationShare
    },
    {
      path: '/backStageManager',
      name: 'backStageManager',
      component: backStageManager,
      children: [
        {
          path: 'leaveSetting',
          name: 'leaveSetting',
          component: leaveSetting
        },
        {
          path: 'peoVacaModify',
          name: 'peoVacaModify',
          component: peoVacaModify
        },

        {
          path: 'degree',
          name: 'degree',
          component: degree
        },
        {
          path: 'personnelRecord',
          name: 'personnelRecord',
          component: PersonnelRecord
        },
        {
          // 用户管理
          path: 'userManager',
          name: 'userManager',
          component: userManager
        },
        {
          // 角色管理
          path: 'roleManage',
          name: 'roleManage',
          component: roleManage
        },
        {
          // 菜单管理
          path: 'menuManage',
          name: 'menuManage',
          component: menuManage
        },
        {
          // 数据管理
          path: 'dataManage',
          name: 'dataManage',
          component: dataManage
        },
        {
          // 权限管理
          path: 'authority',
          name: 'authority',
          component: authority
        },
        {
          path: 'leaderLook',
          name: 'leaderLook',
          component: leaderLook
        },
        {
          path: 'cxoLook',
          name: 'cxoLook',
          component: cxoLook
        },
        {
          path: 'hqStaff',
          name: 'hqStaff',
          component: hqStaff
        },
        {
          path: 'allStaff',
          name: 'allStaff',
          component: allStaff
        },
        {
          path: 'paymentData',
          name: 'paymentData',
          component: paymentData
        },
        {
          path: 'Keypostsettings',
          name: 'Keypostsettings',
          component: Keypostsettings
        },
        {
          path: 'vacaManage',
          name: 'vacaManage',
          component: vacaManage
        },
        {
          path: 'vacaMaintain',
          name: 'vacaMaintain',
          component: vacaMaintain
        },
        {
          path: 'projectManage',
          name: 'projectManage',
          component: projectManage
        },
        {
          path: 'rulesManage',
          name: 'rulesManage',
          component: rulesManage
        },
        {
          path: 'datasManage',
          name: 'datasManage',
          component: datasManage
        },
        {
          path: 'templateManage',
          name: 'templateManage',
          component: templateManage
        },
        {
          path: 'nodeManage',
          name: 'nodeManage',
          component: nodeManage
        },
        {
          path: 'commonManage',
          name: 'commonManage',
          component: commonManage
        },
        {
          path: 'rolesManage',
          name: 'rolesManage',
          component: rolesManage
        },
        {
          path: 'detailManage',
          name: 'detailManage',
          component: detailManage
        },
        {
          path: 'keyEmpployeeTree',
          name: 'keyEmpployeeTree',
          component: keyEmpployeeTree
        },
        {
          path: 'executivePay',
          name: 'executivePay',
          component: executivePay
        },
        {
          //通知公告管理
          path: 'noticeManage',
          name: 'NoticeManage',
          component: NoticeManage
        },
        {
          //招聘管理
          path: 'recruitManage',
          name: 'RecruitManage',
          component: RecruitManage
        },
        {
          //HR指标管理
          path: 'hrTargetManage',
          name: 'HrTargetManage',
          component: HrTargetManage
        },
        {
          //指标业务单位
          path: 'targetBusiness',
          name: 'TargetBusiness',
          component: TargetBusiness
        },
        {
          //人员职级
          path: 'staffRank',
          name: 'StaffRank',
          component: StaffRank
        },
        {
          //各职级人均收入
          path: 'rankPreIncome',
          name: 'RankPreIncome',
          component: RankPreIncome
        },
        {
          //总经理年收入基准值
          path: 'managerPreIncome',
          name: 'ManagerPreIncome',
          component: ManagerPreIncome
        },
        {
          path: 'deptSort',
          name: 'deptSort',
          component: deptSort
        },
        {
          path: 'executivePay',
          name: 'executivePay',
          component: executivePay
        },
        {
          path: 'operation',
          name: 'operation',
          component: operation
        },
        {
          path: 'companyAuthSet',
          name: 'companyAuthSet',
          component: companyAuthSet
        },
        {
          path: 'secretarySetting',
          name: 'secretarySetting',
          component: secretarySetting
        }
      ]
    }
  ]
});
